
#include "stdafx.h"

#include "../../loader.h"
using namespace dlguif;

#include <iostream>
using std::cout;
using std::cerr;
using std::endl;


Loader loader;

void CALLBACK OnGuiEvent(void* user_context, const callback_info* ci)
{
	static int count = 0;
	count ++;

	Loader* ploader = (Loader*)user_context;

	if(ci->eventType == EVENT_TYPE_FORM_CLOSE)
	{
		ploader->PostExit(0);
	}


}


int _tmain(int argc, _TCHAR* argv[])
{
	//Loader loader; //(L"j:/dlguif/dlguif/delphi_dll_project/dlguif.dll");
	loader.SetGuiEventCallBack(OnGuiEvent,  (void*)&loader );

	void* form = loader.CreateForm("caption", "myform", 10, 10, 800, 600);



	void* pnl = loader.CreatePanel(form, form);
	void* pnl2 = loader.CreatePanel(form, form);

  	void* spliter = loader.CreateSpliter(form, form, 6 );
	//loader.SetControlAlign( spliter, alRight);

	loader.SetControlAlign(pnl, alLeft);
	loader.SetControlAlign(pnl2, alClient);



	loader.ShowForm(form);


	while( loader.ProcessMessages() )
	{
		Sleep(1);
	}
 
	return 0;
}